home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 68.7z
/
BS1 part 68
/
InterChange Plus v3.0 (1993-11)(Syndesis)(Disk 2 of 2).7z
/
InterChange Plus v3.0 (1993-11)(Syndesis)(Disk 2 of 2).adf
/
PC_Tools.LZH
/
ALISP.ZIP
/
CONVER.LSP
< prev
next >
Wrap
Lisp/Scheme
|
1993-10-06
|
3KB
|
95 lines
;CONVERT.LSP WRITTEN BY PATRICK MCDONALD 4-4-91
;AUTOLISP STUDENT, BILLINGS VOCATIONAL TECHNICAL CENTER
;CONVERT.LSP WILL CONVERT ALL EXTRUDED LINES INTO 3DFACES. IT WAS WRITTEN TO
;EASE THE TRANSITION OF DRAWINGS FROM ACAD TO 3D STUDIO AS 3D STUDIO DOES NOT
;RECOGNIZE EXTRUDED LINES.
;NOTE -- ALL LINES WILL BE EFFECTED EVEN IF ON FROZEN LAYERS.
;
;Your comments and suggestions are appreciated. Compuserve user# 76264,2273.
(graphscr)
(defun c:convert ()
(setvar "cmdecho" 0)
(initget "Yes No")
(setq qu (getkword "\nConvert polylines as well as lines <Y>/N? "))
(if (or (= qu "Yes") (= qu nil))
(c:plxplode)
)
(prompt "\nConverting extruded lines to 3dfaces...")
(prompt "\nWorking")
(command "ucs" "save" "cucs" "y")
(command "ucsicon" "off")
(command "ucs" "world")
(setq clay (getvar "clayer"))
(setq numb 0)
(setq n (ssget "x" (list (cons 0 "LINE"))))
(if (= n nil) (setq n (ssadd)))
(setq m (ssget "x" (list (cons 0 "3dline"))))
(if (/= m nil)
(progn
(setq count 0)
(repeat (sslength m)
(setq n (ssadd (ssname m count) n))
(setq count (1+ count))
);repeat
);progn
);if
(setq count 0)
(if (/= (ssname n 0) nil)
(repeat (sslength n)
(princ ".")
(setq cent (entget (setq enm (ssname n count))))
(setq th (cdr (assoc 39 cent)))
(if (and (/= th 0) (/= th nil))
(progn
(setq numb (1+ numb))
(command "ucs" "zaxis" "0,0,0" (cdr (assoc 210 cent)))
(setq pt1 (cdr (assoc 10 cent)))
(setq pt2 (cdr (assoc 11 cent)))
(setq pt1 (trans pt1 0 1))
(setq pt2 (trans pt2 0 1))
(setq pt3 (list (car pt1) (cadr pt1) (+ (caddr pt1) th)))
(setq pt4 (list (car pt2) (cadr pt2) (+ (caddr pt2) th)))
(setq lsrch (tblsearch "layer" (cdr (assoc 8 cent))))
(if (= (cdr (assoc 70 lsrch)) 65)
(command "layer" "t" (cdr (assoc 8 cent)) "")
)
(command "layer" "s" (cdr (assoc 8 cent)) "")
(command "3dface" pt1 pt2 pt4 pt3 "")
(if (= (cdr (assoc 70 lsrch)) 65)
(progn
(command "layer" "s" clay "")
(command "layer" "f" (cdr (assoc 8 cent)) "")
))
(command "ucs" "world")
(command "erase" enm "")
);progn
);if
(setq count (1+ count))
);repeat
(prompt"\nNo lines found")
)
(command "redraw")
(command "layer" "s" clay "")
(command "ucs" "r" "cucs")
(command "ucsicon" "on")
(setvar "cmdecho" 1)
(princ (strcat "\nDone " (rtos numb 2 0)" lines converted."))
(princ)
);defun
(defun c:plxplode ()
(setq count 0)
(setq ss (ssget "x" (list (cons 0 "POLYLINE"))))
(prompt "\nExploding polylines")
(if (= ss nil) (prompt"\nNo polylines found")
(repeat (sslength ss)
(command "explode" (ssname ss count))
(setq count (1+ count))
)
)
)
(prompt "\n written by Pat McDonald")
(prompt "\n type 'CONVERT' to convert lines to 3dfaces")
(princ)